const ZipPlugin = require('zip-webpack-plugin')
const resolve = dir => require("path").join(__dirname, dir);
module.exports = {
  assetsDir: 'static',
  lintOnSave: true,
  productionSourceMap: false,
  configureWebpack: config => {
    config.name = '车站售票系统';
    config.plugins.push(
      new ZipPlugin({
        path: resolve('dist'),
        filename: 'dist80.zip'
      })
    );
  },
  devServer: {
    port: 8092,
    proxy: {
      '/api/': {
        port: 8090,
        target: "http://localhost:8090/",
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      },
      '/prodApi/': {
        port: 8090,
        target: 'http://180.76.164.146:8090/',
        changeOrigin: true,
        pathRewrite: {
          '^/prodApi': ''
        }
      }
    }
  }
}
